package com.itheima.d2_string;

public class StringDemo1 {

    public static void main(String[] args) {
        //1.直接双引号得到字符串对象，封装字符串数据
        String s1 = "Hello World";
        System.out.println(s1);
        //2.通过new关键字得到字符串对象，封装字符串数据
        String rs1 = new String();
        System.out.println(rs1);
        String rs2 = new String("卢宇浩大王666");
        System.out.println(rs2);
        char[] chars ={'a','b'};
        String rs3 = new String(chars);
        System.out.println(rs3);
        byte[] bytes ={97,98,99,100};
        String rs4 = new String(bytes);
        System.out.println(rs4);
    }
}
